import os
import sys

import yaml

curPath = os.path.abspath(os.path.dirname(__file__))
rootPath = os.path.split(curPath)[0]
sys.path.append(rootPath)

def getYamlFile():
    PROJECT_ROOT = os.path.dirname(os.path.dirname(__file__))
    CONFIG_PATH=os.path.join(PROJECT_ROOT,'Config.yml')
    ConfigData=open(CONFIG_PATH)
    YmlList=yaml.load(ConfigData,Loader=yaml.FullLoader)
    return YmlList
def getBugPath(name):
    YmlList = getYamlFile()
    Path = YmlList[name]
    PROJECT_ROOT = os.path.dirname(os.path.dirname(__file__))
    REPORT_XLSX_DIR = os.path.join(PROJECT_ROOT, Path)
    return REPORT_XLSX_DIR

if __name__ == '__main__':
    print(getBugPath("BugPath"))